package com.zgjkhis.modules.charges.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yzq
 * @Description 发票
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_prescription_refund")
public class PrescriptionRefund implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "订单号")
    private String orderNo;
    @ApiModelProperty(value = "退款金额")
    private BigDecimal refund;
    @ApiModelProperty(value = "退款金额(折扣)")
    private BigDecimal refundPrice;
    @ApiModelProperty(value = "退款单号")
    private String refundNo;
    @ApiModelProperty(value = "退款原因")
    private String refundMsg;
    @ApiModelProperty(value = "退款日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date refundTime;
    @ApiModelProperty(value = "实际退款金额")
    private BigDecimal actRefund;
    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "药房id",required = true)
    @NotNull(message = "药房id不能为空")
    private String pharmacyId;

    public void copy(PrescriptionRefund source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
